<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        // $  以。。。结尾
        // ^  以。。。开头


        // 一个正则只有加上限定符  才会把规则定死

        var reg = /^1[0-9]{10}$/;
        console.log(reg.test('12345678901'));

    </script>

</body>

</html>